<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>传智健康</title>
    <link rel="stylesheet" href="../css/page-health-index.css" />
    <link rel="stylesheet" href="../css/page-health-orderInfo.css">
    <link rel="stylesheet" href="../plugins/elementui/index.css" />
    <script src="../plugins/datapicker/datePicker.js"></script>
    <script src="../plugins/jquery/dist/jquery.min.js"></script>
    <script src="../plugins/healthmobile.js"></script>
    <script src="../plugins/vue/vue.js"></script>
    <script src="../plugins/vue/axios-0.18.0.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <script>
        var id = getUrlParam("id");//预约id
    </script>
</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div class="app" id="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">传智健康</span>
    </div>
    <!-- 页面内容 -->
    <div class="contentBox">
        <div class="form-info">
            <form class="info-form">
                <div class="date">
                    <label>开始时间</label>
                    <i class="icon-date" class="picktime"></i>
                    <input id="starttime" v-model="startDate" type="text" class="picktime">
                    <br/>
                    <label>结束时间</label>
                    <i class="icon-date" class="picktime2"></i>
                    <input id="endtime" v-model="endDate" type="text" class="picktime2">
                    <el-row>
                        <el-col :span="24" :offset="10">
                            <el-button type="primary" plain @click="select">查询</el-button>
                        </el-col>
                    </el-row>
                </div>
            </form>
        </div>
        <!--
        {"data":
            [
                {
                    "memberName":"小明",
                    "setmealName":"粉红珍爱(女)升级TM12项筛查体检套餐"
                }
            ],
            "flag":true,
            "message":"查询成功"
        }
        -->
        <div class="list-column2">
            <ul class="list" v-for="setmeal in setmealList">
                <li class="type-item" style="width: 100%" @click="changeurl(setmeal)">
                    <a class="link-page">
                        <div class="type-title">
                            <h3>体检人：{{setmeal.memberName}}</h3>
                            <p>预约套餐：{{setmeal.setmealName}}</p>
                            <p aria-hidden="true">预约套餐：{{setmeal.order_id}}</p>
                            <p>点击查看详细信息</p>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
<script>
    var vue = new Vue({
        el: '#app',
        data:{
            startDate:'',
            endDate:'',
            setmealList:[]
        },
        methods:{
            select(){
                //根据日期查询
                axios.get("/setmeal/findByDate.do?startDate="+this.startDate+"&endDate="+this.endDate).then((resp)=>{
                    if (resp.data.flag){
                        this.setmealList=resp.data.data;
                    }
                })
            },
            changeurl(setmeal){
                window.location.href="history_order_detail.html?id="+setmeal.id + "&order_id=" + setmeal.order_id;
            }
        }
    });
</script>
<script>
    //日期控件
    var calendar = new datePicker();
    calendar.init({
        'trigger': '.picktime',/*按钮选择器，用于触发弹出插件*/
        'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
        'onSubmit': function() { /*确认时触发事件*/
            //var theSelectData = calendar.value;
        },
        'onClose': function() { /*取消时触发事件*/ }
    });
</script>
<script>
    //日期控件
    var calendar = new datePicker();
    calendar.init({
        'trigger': '.picktime2',/*按钮选择器，用于触发弹出插件*/
        'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
        'onSubmit': function() { /*确认时触发事件*/
            //var theSelectData = calendar.value;
        },
        'onClose': function() { /*取消时触发事件*/ }
    });
</script>
</body>
</html>